home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 10 / BBS In A Box Volume X (AMUG) (January 1994).bin / Files / Prog / U-Z / VideoToolBox.cpt / VideoToolboxSources / GDOpenWindow.c < prev    next >
MacBinary  |  1993-03-07  |  8.0 KB  |  [TEXT/KAHL]

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: MacBinary (archive/macBinary).

ConfidenceProgramDetectionMatch TypeSupport
66% dexvert Compact Compressed (Unix) (archive/compact) ext Supported
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, inited, Sun Mar 7 01:31:07 1993, modified Sun Mar 7 01:31:07 1993, creator Think C, type ASCII, 7444 bytes "GDOpenWindow.c" , at 0x1d94 492 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[KAHL]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0e 47 44 4f 70 65 6e | 57 69 6e 64 6f 77 2e 63 |..GDOpen|Window.c|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4b 41 48 | 4c 01 00 00 00 00 00 00 |.TEXTKAH|L.......|
|00000050| 00 00 00 00 00 1d 14 00 | 00 01 ec a7 bf 47 2b a7 |........|.....G+.|
|00000060| bf 47 2b 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |.G+.....|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 e0 fa 00 00 |........|........|
|00000080| 2f 2a 20 47 44 4f 70 65 | 6e 57 69 6e 64 6f 77 2e |/* GDOpe|nWindow.|
|00000090| 63 0d 43 6f 70 79 72 69 | 67 68 74 20 a9 20 31 39 |c.Copyri|ght . 19|
|000000a0| 38 39 2d 31 39 39 33 20 | 44 65 6e 69 73 20 47 2e |89-1993 |Denis G.|
|000000b0| 20 50 65 6c 6c 69 0d 0d | 53 55 4d 4d 41 52 59 3a | Pelli..|SUMMARY:|
|000000c0| 0d 0d 41 64 64 45 78 70 | 6c 69 63 69 74 50 61 6c |..AddExp|licitPal|
|000000d0| 65 74 74 65 28 29 20 61 | 64 64 73 20 61 20 70 61 |ette() a|dds a pa|
|000000e0| 6c 65 74 74 65 20 74 6f | 20 61 20 63 6f 6c 6f 72 |lette to| a color|
|000000f0| 20 77 69 6e 64 6f 77 20 | 77 69 74 68 20 61 6c 6c | window |with all|
|00000100| 20 74 68 65 20 63 6f 6c | 6f 72 73 20 6d 61 72 6b | the col|ors mark|
|00000110| 65 64 0d 61 73 20 70 6d | 45 78 70 6c 69 63 69 74 |ed.as pm|Explicit|
|00000120| 2e 20 54 68 69 73 20 61 | 6c 6c 6f 77 73 20 79 6f |. This a|llows yo|
|00000130| 75 20 74 6f 20 73 70 65 | 63 69 66 79 20 61 20 63 |u to spe|cify a c|
|00000140| 6f 6c 6f 72 20 62 79 20 | 69 74 73 20 63 6c 75 74 |olor by |its clut|
|00000150| 20 69 6e 64 65 78 2c 20 | 75 73 69 6e 67 0d 50 6d | index, |using.Pm|
|00000160| 46 6f 72 65 43 6f 6c 6f | 72 28 29 20 61 6e 64 20 |ForeColo|r() and |
|00000170| 50 6d 42 61 63 6b 43 6f | 6c 6f 72 28 29 2c 20 66 |PmBackCo|lor(), f|
|00000180| 6f 72 20 64 72 61 77 69 | 6e 67 20 6f 70 65 72 61 |or drawi|ng opera|
|00000190| 74 69 6f 6e 73 2c 20 65 | 2e 67 2e 20 45 72 61 73 |tions, e|.g. Eras|
|000001a0| 65 52 65 63 74 28 29 20 | 61 6e 64 0d 44 72 61 77 |eRect() |and.Draw|
|000001b0| 53 74 72 69 6e 67 28 29 | 2e 0d 0d 47 44 4f 70 65 |String()|...GDOpe|
|000001c0| 6e 57 69 6e 64 6f 77 31 | 20 6f 70 65 6e 73 20 61 |nWindow1| opens a|
|000001d0| 20 66 75 6c 6c 2d 73 63 | 72 65 65 6e 20 77 69 6e | full-sc|reen win|
|000001e0| 64 6f 77 20 6f 6e 20 74 | 68 65 20 73 70 65 63 69 |dow on t|he speci|
|000001f0| 66 69 65 64 20 73 63 72 | 65 65 6e 2c 20 61 6e 64 |fied scr|een, and|
|00000200| 20 63 61 6c 6c 73 0d 41 | 64 64 45 78 70 6c 69 63 | calls.A|ddExplic|
|00000210| 69 74 50 61 6c 65 74 74 | 65 2e 20 54 68 65 20 77 |itPalett|e. The w|
|00000220| 69 6e 64 6f 77 20 74 72 | 75 6c 79 20 66 69 6c 6c |indow tr|uly fill|
|00000230| 73 20 74 68 65 20 73 63 | 72 65 65 6e 3a 20 61 6e |s the sc|reen: an|
|00000240| 79 20 72 6f 75 6e 64 65 | 64 20 63 6f 72 6e 65 72 |y rounde|d corner|
|00000250| 73 20 61 72 65 0d 6d 61 | 64 65 20 73 71 75 61 72 |s are.ma|de squar|
|00000260| 65 20 61 6e 64 20 69 66 | 20 74 68 65 20 77 69 6e |e and if| the win|
|00000270| 64 6f 77 20 69 73 20 6f | 6e 20 74 68 65 20 6d 61 |dow is o|n the ma|
|00000280| 69 6e 20 73 63 72 65 65 | 6e 20 74 68 65 6e 20 74 |in scree|n then t|
|00000290| 68 65 20 4d 65 6e 75 20 | 42 61 72 20 69 73 0d 68 |he Menu |Bar is.h|
|000002a0| 69 64 64 65 6e 2e 0d 0d | 47 44 44 69 73 70 6f 73 |idden...|GDDispos|
|000002b0| 65 57 69 6e 64 6f 77 31 | 28 29 20 63 6c 6f 73 65 |eWindow1|() close|
|000002c0| 73 20 61 6e 64 20 64 69 | 73 63 61 72 64 73 20 61 |s and di|scards a|
|000002d0| 20 63 6f 6c 6f 72 20 77 | 69 6e 64 6f 77 2c 20 64 | color w|indow, d|
|000002e0| 69 73 70 6f 73 69 6e 67 | 20 6f 66 20 61 6e 79 20 |isposing| of any |
|000002f0| 70 61 6c 65 74 74 65 0d | 6f 72 20 63 6f 6c 6f 72 |palette.|or color|
|00000300| 20 74 61 62 6c 65 2c 20 | 67 65 6e 65 72 61 6c 6c | table, |generall|
|00000310| 79 20 75 6e 64 6f 69 6e | 67 20 77 68 61 74 65 76 |y undoin|g whatev|
|00000320| 65 72 20 47 44 4f 70 65 | 6e 57 69 6e 64 6f 77 31 |er GDOpe|nWindow1|
|00000330| 20 64 69 64 2e 0d 0d 54 | 68 65 73 65 20 72 6f 75 | did...T|hese rou|
|00000340| 74 69 6e 65 73 20 72 65 | 74 75 72 6e 20 61 6e 64 |tines re|turn and|
|00000350| 20 61 63 63 65 70 74 20 | 61 20 57 69 6e 64 6f 77 | accept |a Window|
|00000360| 50 74 72 20 28 65 76 65 | 6e 20 74 68 6f 75 67 68 |Ptr (eve|n though|
|00000370| 20 69 74 27 73 20 61 63 | 74 75 61 6c 6c 79 0d 61 | it's ac|tually.a|
|00000380| 20 63 6f 6c 6f 72 20 77 | 69 6e 64 6f 77 29 2c 20 | color w|indow), |
|00000390| 77 68 69 63 68 20 73 65 | 65 6d 73 20 74 6f 20 62 |which se|ems to b|
|000003a0| 65 20 74 68 65 20 73 74 | 61 6e 64 61 72 64 20 77 |e the st|andard w|
|000003b0| 61 79 20 6f 66 20 64 6f | 69 6e 67 20 74 68 69 6e |ay of do|ing thin|
|000003c0| 67 73 2e 20 0d 54 68 65 | 20 6f 6c 64 65 72 20 72 |gs. .The| older r|
|000003d0| 6f 75 74 69 6e 65 73 2c | 20 77 69 74 68 6f 75 74 |outines,| without|
|000003e0| 20 74 68 65 20 22 31 22 | 20 73 75 66 66 69 78 2c | the "1"| suffix,|
|000003f0| 20 72 65 74 75 72 6e 20 | 61 6e 64 20 61 63 63 65 | return |and acce|
|00000400| 70 74 20 61 20 43 57 69 | 6e 64 6f 77 50 74 72 2c |pt a CWi|ndowPtr,|
|00000410| 0d 77 68 69 63 68 20 65 | 6e 64 73 20 75 70 20 66 |.which e|nds up f|
|00000420| 6f 72 63 69 6e 67 20 79 | 6f 75 20 74 6f 20 64 6f |orcing y|ou to do|
|00000430| 20 61 20 6c 6f 74 20 6f | 66 20 74 65 64 69 6f 75 | a lot o|f tediou|
|00000440| 73 20 63 61 73 74 69 6e | 67 2c 20 65 2e 67 2e 20 |s castin|g, e.g. |
|00000450| 77 68 65 6e 20 79 6f 75 | 20 63 61 6c 6c 0d 53 65 |when you| call.Se|
|00000460| 74 50 6f 72 74 28 29 2c | 20 77 68 69 63 68 20 77 |tPort(),| which w|
|00000470| 61 6e 74 73 20 61 20 57 | 69 6e 64 6f 77 50 74 72 |ants a W|indowPtr|
|00000480| 2e 0d 0d 43 4f 4d 4d 45 | 4e 54 53 3a 0d 0d 51 75 |...COMME|NTS:..Qu|
|00000490| 69 63 6b 44 72 61 77 20 | 6c 69 6b 65 73 20 74 6f |ickDraw |likes to|
|000004a0| 20 70 69 63 6b 20 61 20 | 62 75 6e 63 68 20 6f 66 | pick a |bunch of|
|000004b0| 20 67 6f 6f 64 20 63 6f | 6c 6f 72 73 20 61 6e 64 | good co|lors and|
|000004c0| 20 73 74 75 66 66 20 74 | 68 65 6d 20 69 6e 20 74 | stuff t|hem in t|
|000004d0| 68 65 20 63 6c 75 74 2c | 20 69 6e 0d 65 73 73 65 |he clut,| in.esse|
|000004e0| 6e 74 69 61 6c 6c 79 20 | 72 61 6e 64 6f 6d 20 6f |ntially |random o|
|000004f0| 72 64 65 72 2c 20 65 78 | 63 65 70 74 20 74 68 61 |rder, ex|cept tha|
|00000500| 74 20 77 68 69 74 65 20 | 69 73 20 66 69 72 73 74 |t white |is first|
|00000510| 20 61 6e 64 20 62 6c 61 | 63 6b 20 69 73 20 6c 61 | and bla|ck is la|
|00000520| 73 74 2e 20 49 74 20 77 | 61 6e 74 73 0d 79 6f 75 |st. It w|ants.you|
|00000530| 20 74 6f 20 73 70 65 63 | 69 66 79 20 61 6e 79 20 | to spec|ify any |
|00000540| 64 65 73 69 72 65 64 20 | 63 6f 6c 6f 72 20 61 73 |desired |color as|
|00000550| 20 61 6e 20 52 47 42 20 | 74 72 69 70 6c 65 74 20 | an RGB |triplet |
|00000560| 61 6e 64 20 74 68 65 6e | 20 69 74 20 70 69 63 6b |and then| it pick|
|00000570| 73 20 74 68 65 20 6d 79 | 73 74 65 72 69 6f 75 73 |s the my|sterious|
|00000580| 0d 63 6c 75 74 20 69 6e | 64 65 78 20 74 68 61 74 |.clut in|dex that|
|00000590| 20 77 6f 75 6c 64 20 70 | 72 6f 76 69 64 65 20 74 | would p|rovide t|
|000005a0| 68 65 20 63 6c 6f 73 65 | 73 74 20 6d 61 74 63 68 |he close|st match|
|000005b0| 2e 20 49 66 20 79 6f 75 | 27 72 65 20 70 72 6f 63 |. If you|'re proc|
|000005c0| 65 73 73 69 6e 67 20 67 | 72 61 79 73 63 61 6c 65 |essing g|rayscale|
|000005d0| 0d 69 6d 61 67 65 73 2c | 20 74 68 65 6e 20 51 75 |.images,| then Qu|
|000005e0| 69 63 6b 44 72 61 77 27 | 73 20 61 70 70 72 6f 61 |ickDraw'|s approa|
|000005f0| 63 68 20 69 6e 76 6f 6c | 76 65 73 20 61 20 6c 6f |ch invol|ves a lo|
|00000600| 74 20 6f 66 20 6f 76 65 | 72 68 65 61 64 20 69 6e |t of ove|rhead in|
|00000610| 76 6f 6c 76 69 6e 67 20 | 69 6e 76 65 72 73 65 0d |volving |inverse.|
|00000620| 63 6f 6c 6f 72 20 74 61 | 62 6c 65 73 2c 20 61 6e |color ta|bles, an|
|00000630| 64 20 6d 61 6b 65 73 20 | 74 68 65 20 6e 75 6d 62 |d makes |the numb|
|00000640| 65 72 73 20 73 74 6f 72 | 65 64 20 69 6e 20 79 6f |ers stor|ed in yo|
|00000650| 75 72 20 70 69 78 65 6c | 73 20 6d 65 61 6e 69 6e |ur pixel|s meanin|
|00000660| 67 6c 65 73 73 20 28 75 | 6e 6c 65 73 73 0d 79 6f |gless (u|nless.yo|
|00000670| 75 20 6c 6f 6f 6b 20 74 | 68 65 6d 20 75 70 20 69 |u look t|hem up i|
|00000680| 6e 20 74 68 65 20 61 73 | 73 6f 63 69 61 74 65 64 |n the as|sociated|
|00000690| 20 63 6f 6c 6f 72 20 74 | 61 62 6c 65 20 6f 72 20 | color t|able or |
|000006a0| 70 61 6c 65 74 74 65 29 | 2e 0d 0d 54 68 65 20 70 |palette)|...The p|
|000006b0| 68 69 6c 6f 73 6f 70 68 | 79 20 6f 66 20 74 68 65 |hilosoph|y of the|
|000006c0| 20 56 69 64 65 6f 54 6f | 6f 6c 62 6f 78 20 69 73 | VideoTo|olbox is|
|000006d0| 20 74 6f 20 62 79 70 61 | 73 73 20 51 75 69 63 6b | to bypa|ss Quick|
|000006e0| 44 72 61 77 27 73 20 63 | 6f 6c 6f 72 20 6d 6f 64 |Draw's c|olor mod|
|000006f0| 65 6c 2c 20 61 6e 64 0d | 77 6f 72 6b 20 65 78 70 |el, and.|work exp|
|00000700| 6c 69 63 69 74 6c 79 20 | 77 69 74 68 20 74 68 65 |licitly |with the|
|00000710| 20 6e 75 6d 62 65 72 73 | 20 74 68 61 74 20 61 72 | numbers| that ar|
|00000720| 65 20 73 74 6f 72 65 64 | 20 69 6e 20 79 6f 75 72 |e stored| in your|
|00000730| 20 70 69 78 65 6c 73 2e | 0d 53 65 74 50 69 78 65 | pixels.|.SetPixe|
|00000740| 6c 73 51 75 69 63 6b 6c | 79 20 77 69 6c 6c 20 65 |lsQuickl|y will e|
|00000750| 66 66 69 63 69 65 6e 74 | 6c 79 20 70 6f 6b 65 20 |fficient|ly poke |
|00000760| 28 6f 72 20 70 65 65 6b | 29 20 6e 75 6d 62 65 72 |(or peek|) number|
|00000770| 73 20 69 6e 20 79 6f 75 | 72 20 50 69 78 4d 61 70 |s in you|r PixMap|
|00000780| 2e 0d 48 6f 77 65 76 65 | 72 2c 20 69 66 20 79 6f |..Howeve|r, if yo|
|00000790| 75 20 77 61 6e 74 20 74 | 6f 20 75 73 65 20 51 75 |u want t|o use Qu|
|000007a0| 69 63 6b 44 72 61 77 27 | 73 20 64 72 61 77 69 6e |ickDraw'|s drawin|
|000007b0| 67 20 6f 70 65 72 61 74 | 69 6f 6e 73 2c 20 65 73 |g operat|ions, es|
|000007c0| 70 65 63 69 61 6c 6c 79 | 0d 45 72 61 73 65 52 65 |pecially|.EraseRe|
|000007d0| 63 74 28 29 20 61 6e 64 | 20 44 72 61 77 53 74 72 |ct() and| DrawStr|
|000007e0| 69 6e 67 28 29 20 74 68 | 65 6e 20 79 6f 75 20 6e |ing() th|en you n|
|000007f0| 65 65 64 20 61 20 77 61 | 79 20 74 6f 20 73 70 65 |eed a wa|y to spe|
|00000800| 63 69 66 79 20 74 68 65 | 20 66 6f 72 65 67 72 6f |cify the| foregro|
|00000810| 75 6e 64 20 61 6e 64 0d | 62 61 63 6b 67 72 6f 75 |und and.|backgrou|
|00000820| 6e 64 20 63 6f 6c 6f 72 | 73 2e 20 41 64 64 45 78 |nd color|s. AddEx|
|00000830| 70 6c 69 63 69 74 50 61 | 6c 65 74 74 65 28 29 20 |plicitPa|lette() |
|00000840| 67 69 76 65 73 20 79 6f | 75 72 20 77 69 6e 64 6f |gives yo|ur windo|
|00000850| 77 20 61 20 70 61 6c 65 | 74 74 65 20 69 6e 20 77 |w a pale|tte in w|
|00000860| 68 69 63 68 20 61 6c 6c | 0d 74 68 65 20 63 6f 6c |hich all|.the col|
|00000870| 6f 72 73 20 61 72 65 20 | 6d 61 72 6b 65 64 20 61 |ors are |marked a|
|00000880| 73 20 70 6d 45 78 70 6c | 69 63 69 74 2e 20 54 68 |s pmExpl|icit. Th|
|00000890| 69 73 20 74 65 6c 6c 73 | 20 74 68 65 20 70 61 6c |is tells| the pal|
|000008a0| 65 74 74 65 20 6d 61 6e | 61 67 65 72 20 6e 6f 74 |ette man|ager not|
|000008b0| 20 74 6f 0d 6d 65 64 64 | 6c 65 2c 20 61 6e 64 20 | to.medd|le, and |
|000008c0| 74 6f 20 75 73 65 20 79 | 6f 75 72 20 61 72 67 75 |to use y|our argu|
|000008d0| 6d 65 6e 74 73 20 74 6f | 20 50 6d 46 6f 72 65 43 |ments to| PmForeC|
|000008e0| 6f 6c 6f 72 28 29 20 61 | 6e 64 20 50 6d 42 61 63 |olor() a|nd PmBac|
|000008f0| 6b 43 6f 6c 6f 72 28 29 | 20 6c 69 74 65 72 61 6c |kColor()| literal|
|00000900| 6c 79 2e 0d 0d 49 20 73 | 75 67 67 65 73 74 20 74 |ly...I s|uggest t|
|00000910| 68 61 74 20 79 6f 75 20 | 63 6f 6e 74 72 6f 6c 20 |hat you |control |
|00000920| 74 68 65 20 63 6c 75 74 | 20 62 79 20 63 61 6c 6c |the clut| by call|
|00000930| 69 6e 67 20 47 44 55 6e | 63 6f 72 72 65 63 74 65 |ing GDUn|correcte|
|00000940| 64 47 61 6d 6d 61 28 29 | 20 61 6e 64 0d 47 44 53 |dGamma()| and.GDS|
|00000950| 65 74 45 6e 74 72 69 65 | 73 28 29 2c 20 73 69 6e |etEntrie|s(), sin|
|00000960| 63 65 20 74 68 65 73 65 | 20 63 61 6c 6c 73 20 64 |ce these| calls d|
|00000970| 69 72 65 63 74 6c 79 20 | 63 6f 6e 74 72 6f 6c 20 |irectly |control |
|00000980| 74 68 65 20 76 69 64 65 | 6f 20 64 65 76 69 63 65 |the vide|o device|
|00000990| 20 64 72 69 76 65 72 2c | 0d 62 79 70 61 73 73 69 | driver,|.bypassi|
|000009a0| 6e 67 20 74 68 65 20 43 | 6f 6c 6f 72 20 4d 61 6e |ng the C|olor Man|
|000009b0| 61 67 65 72 2e 20 53 69 | 6e 63 65 20 74 68 65 20 |ager. Si|nce the |
|000009c0| 43 6f 6c 6f 72 20 61 6e | 64 20 50 61 6c 65 74 74 |Color an|d Palett|
|000009d0| 65 20 4d 61 6e 61 67 65 | 72 73 20 64 6f 6e 27 74 |e Manage|rs don't|
|000009e0| 20 6b 6e 6f 77 0d 74 68 | 61 74 20 79 6f 75 27 76 | know.th|at you'v|
|000009f0| 65 20 63 68 61 6e 67 65 | 64 20 74 68 65 20 63 6f |e change|d the co|
|00000a00| 6c 6f 72 20 65 6e 76 69 | 72 6f 6e 6d 65 6e 74 20 |lor envi|ronment |
|00000a10| 74 68 65 79 20 63 61 6e | 27 74 20 72 65 61 63 74 |they can|'t react|
|00000a20| 20 74 6f 20 69 74 2c 20 | 61 6e 64 20 77 69 6c 6c | to it, |and will|
|00000a30| 0d 70 61 73 73 69 76 65 | 6c 79 20 6c 65 74 20 79 |.passive|ly let y|
|00000a40| 6f 75 20 63 6f 6e 74 69 | 6e 75 65 20 74 6f 20 73 |ou conti|nue to s|
|00000a50| 70 65 63 69 66 79 20 63 | 6f 6c 6f 72 73 20 62 79 |pecify c|olors by|
|00000a60| 20 74 68 65 69 72 20 63 | 6c 75 74 20 69 6e 64 65 | their c|lut inde|
|00000a70| 78 2e 20 46 6f 72 20 65 | 78 61 6d 70 6c 65 2c 0d |x. For e|xample,.|
|00000a80| 74 68 65 20 50 61 6c 65 | 74 74 65 20 4d 61 6e 61 |the Pale|tte Mana|
|00000a90| 67 65 72 20 72 65 6c 69 | 67 69 6f 75 73 6c 79 20 |ger reli|giously |
|00000aa0| 62 65 6c 69 65 76 65 73 | 20 74 68 61 74 20 74 68 |believes| that th|
|00000ab0| 65 20 66 69 72 73 74 20 | 63 6c 75 74 20 65 6e 74 |e first |clut ent|
|00000ac0| 72 79 20 73 68 6f 75 6c | 64 20 62 65 0d 77 68 69 |ry shoul|d be.whi|
|00000ad0| 74 65 20 61 6e 64 20 74 | 68 65 20 6c 61 73 74 20 |te and t|he last |
|00000ae0| 6f 6e 65 20 62 6c 61 63 | 6b 2c 20 61 6e 64 20 69 |one blac|k, and i|
|00000af0| 74 20 77 69 6c 6c 20 63 | 68 61 6e 67 65 20 74 68 |t will c|hange th|
|00000b00| 65 6d 20 62 61 63 6b 20 | 74 6f 20 74 68 6f 73 65 |em back |to those|
|00000b10| 20 76 61 6c 75 65 73 20 | 69 66 0d 79 6f 75 20 63 | values |if.you c|
|00000b20| 68 61 6e 67 65 20 74 68 | 65 6d 20 61 6e 64 20 69 |hange th|em and i|
|00000b30| 74 20 66 69 6e 64 73 20 | 6f 75 74 20 61 62 6f 75 |t finds |out abou|
|00000b40| 74 20 69 74 2e 20 49 66 | 20 79 6f 75 20 75 73 65 |t it. If| you use|
|00000b50| 20 74 68 65 20 43 6f 6c | 6f 72 20 4d 61 6e 61 67 | the Col|or Manag|
|00000b60| 65 72 0d 53 65 74 45 6e | 74 72 69 65 73 20 63 61 |er.SetEn|tries ca|
|00000b70| 6c 6c 20 74 68 65 6e 20 | 74 68 65 20 50 61 6c 65 |ll then |the Pale|
|00000b80| 74 74 65 72 20 4d 61 6e | 67 65 72 20 57 49 4c 4c |tter Man|ger WILL|
|00000b90| 20 66 69 6e 64 20 6f 75 | 74 20 62 65 63 61 75 73 | find ou|t becaus|
|00000ba0| 65 20 61 20 72 65 63 6f | 72 64 20 69 73 20 6d 61 |e a reco|rd is ma|
|00000bb0| 64 65 0d 69 6e 20 74 68 | 65 20 43 6f 6c 6f 72 54 |de.in th|e ColorT|
|00000bc0| 61 62 6c 65 2e 20 43 61 | 6c 6c 69 6e 67 20 47 44 |able. Ca|lling GD|
|00000bd0| 53 65 74 45 6e 74 72 69 | 65 73 28 29 20 62 79 70 |SetEntri|es() byp|
|00000be0| 61 73 73 65 73 20 74 68 | 65 20 43 6f 6c 6f 72 20 |asses th|e Color |
|00000bf0| 4d 61 6e 61 67 65 72 2c | 20 69 6e 73 74 65 61 64 |Manager,| instead|
|00000c00| 0d 74 68 65 20 76 69 64 | 65 6f 20 64 65 76 69 63 |.the vid|eo devic|
|00000c10| 65 20 64 72 69 76 65 72 | 20 77 72 69 74 65 73 20 |e driver| writes |
|00000c20| 64 69 72 65 63 74 6c 79 | 20 74 6f 20 74 68 65 20 |directly| to the |
|00000c30| 63 6c 75 74 20 61 6e 64 | 20 74 68 65 20 43 6f 6c |clut and| the Col|
|00000c40| 6f 72 54 61 62 6c 65 20 | 69 73 20 6e 6f 74 0d 6d |orTable |is not.m|
|00000c50| 6f 64 69 66 69 65 64 2e | 20 4f 66 20 63 6f 75 72 |odified.| Of cour|
|00000c60| 73 65 2c 20 74 68 69 73 | 20 6d 65 61 6e 73 20 74 |se, this| means t|
|00000c70| 68 61 74 20 79 6f 75 20 | 73 68 6f 75 6c 64 20 69 |hat you |should i|
|00000c80| 67 6e 6f 72 65 20 74 68 | 65 20 43 6f 6c 6f 72 54 |gnore th|e ColorT|
|00000c90| 61 62 6c 65 20 73 69 6e | 63 65 20 69 74 0d 77 69 |able sin|ce it.wi|
|00000ca0| 6c 6c 20 6e 6f 20 6c 6f | 6e 67 65 72 20 72 65 66 |ll no lo|nger ref|
|00000cb0| 6c 65 63 74 20 74 68 65 | 20 63 6f 6e 74 65 6e 74 |lect the| content|
|00000cc0| 73 20 6f 66 20 74 68 65 | 20 63 6c 75 74 2e 0d 0d |s of the| clut...|
|00000cd0| 54 68 65 20 49 6e 73 69 | 64 65 20 4d 61 63 20 62 |The Insi|de Mac b|
|00000ce0| 6f 6f 6b 73 20 73 75 67 | 67 65 73 74 20 74 68 61 |ooks sug|gest tha|
|00000cf0| 74 20 61 20 6e 65 77 20 | 63 6f 6c 6f 72 20 77 69 |t a new |color wi|
|00000d00| 6e 64 6f 77 20 73 68 6f | 75 6c 64 20 62 65 20 67 |ndow sho|uld be g|
|00000d10| 69 76 65 6e 20 69 74 73 | 20 6f 77 6e 0d 63 6f 6c |iven its| own.col|
|00000d20| 6f 72 20 74 61 62 6c 65 | 2e 20 54 68 69 73 20 77 |or table|. This w|
|00000d30| 69 6c 6c 20 68 61 70 70 | 65 6e 20 69 66 20 79 6f |ill happ|en if yo|
|00000d40| 75 20 73 65 74 20 4d 41 | 4b 45 5f 43 4f 4c 4f 52 |u set MA|KE_COLOR|
|00000d50| 5f 54 41 42 4c 45 20 74 | 72 75 65 2e 20 48 6f 77 |_TABLE t|rue. How|
|00000d60| 65 76 65 72 2c 20 66 6f | 72 20 6d 79 0d 70 75 72 |ever, fo|r my.pur|
|00000d70| 70 6f 73 65 73 20 49 20 | 74 68 69 6e 6b 20 6f 66 |poses I |think of|
|00000d80| 20 74 68 65 20 77 69 6e | 64 6f 77 20 61 6e 64 20 | the win|dow and |
|00000d90| 74 68 65 20 73 63 72 65 | 65 6e 20 61 73 20 65 73 |the scre|en as es|
|00000da0| 73 65 6e 74 69 61 6c 6c | 79 20 74 68 65 20 73 61 |sentiall|y the sa|
|00000db0| 6d 65 20 74 68 69 6e 67 | 2c 20 73 6f 0d 49 20 67 |me thing|, so.I g|
|00000dc0| 69 76 65 20 74 68 65 20 | 77 69 6e 64 6f 77 20 61 |ive the |window a|
|00000dd0| 20 68 61 6e 64 6c 65 20 | 74 6f 20 74 68 65 20 73 | handle |to the s|
|00000de0| 63 72 65 65 6e 27 73 20 | 63 6f 6c 6f 72 20 74 61 |creen's |color ta|
|00000df0| 62 6c 65 2c 20 73 6f 20 | 74 68 65 79 20 73 68 61 |ble, so |they sha|
|00000e00| 72 65 20 74 68 65 20 73 | 61 6d 65 0d 74 61 62 6c |re the s|ame.tabl|
|00000e10| 65 2e 0d 0d 45 76 65 72 | 79 20 74 69 6d 65 20 79 |e...Ever|y time y|
|00000e20| 6f 75 20 61 63 63 65 73 | 73 20 74 68 65 20 73 74 |ou acces|s the st|
|00000e30| 64 69 6f 20 70 61 63 6b | 61 67 65 2c 20 65 2e 67 |dio pack|age, e.g|
|00000e40| 2e 20 70 72 69 6e 74 66 | 20 6f 72 20 67 65 74 63 |. printf| or getc|
|00000e50| 68 28 29 2c 20 54 48 49 | 4e 4b 20 43 20 77 69 6c |h(), THI|NK C wil|
|00000e60| 6c 0d 6d 6f 76 65 20 74 | 68 65 20 43 6f 6e 73 6f |l.move t|he Conso|
|00000e70| 6c 65 20 77 69 6e 64 6f | 77 20 74 6f 20 74 68 65 |le windo|w to the|
|00000e80| 20 66 72 6f 6e 74 2c 20 | 77 68 69 63 68 20 6d 61 | front, |which ma|
|00000e90| 79 20 6f 62 73 63 75 72 | 65 20 79 6f 75 72 20 77 |y obscur|e your w|
|00000ea0| 69 6e 64 6f 77 2e 20 59 | 6f 75 20 63 61 6e 0d 62 |indow. Y|ou can.b|
|00000eb0| 72 69 6e 67 20 79 6f 75 | 72 20 77 69 6e 64 6f 77 |ring you|r window|
|00000ec0| 20 62 61 63 6b 20 74 6f | 20 74 68 65 20 66 72 6f | back to| the fro|
|00000ed0| 6e 74 20 62 79 20 63 61 | 6c 6c 69 6e 67 20 42 72 |nt by ca|lling Br|
|00000ee0| 69 6e 67 54 6f 46 72 6f | 6e 74 28 29 2e 0d 0d 45 |ingToFro|nt()...E|
|00000ef0| 58 41 4d 50 4c 45 3a 0d | 0d 4f 70 65 6e 20 79 6f |XAMPLE:.|.Open yo|
|00000f00| 75 72 20 77 69 6e 64 6f | 77 20 62 79 20 73 61 79 |ur windo|w by say|
|00000f10| 69 6e 67 3a 0d 09 77 69 | 6e 64 6f 77 3d 47 44 4f |ing:..wi|ndow=GDO|
|00000f20| 70 65 6e 57 69 6e 64 6f | 77 31 28 64 65 76 69 63 |penWindo|w1(devic|
|00000f30| 65 29 3b 0d 57 68 65 6e | 20 79 6f 75 27 72 65 20 |e);.When| you're |
|00000f40| 74 68 72 6f 75 67 68 20 | 77 69 74 68 20 74 68 65 |through |with the|
|00000f50| 20 77 69 6e 64 6f 77 2c | 20 67 65 74 20 72 69 64 | window,| get rid|
|00000f60| 20 6f 66 20 69 74 20 62 | 79 20 63 61 6c 6c 69 6e | of it b|y callin|
|00000f70| 67 3a 0d 09 47 44 44 69 | 73 70 6f 73 65 57 69 6e |g:..GDDi|sposeWin|
|00000f80| 64 6f 77 31 28 77 69 6e | 64 6f 77 29 3b 0d 42 65 |dow1(win|dow);.Be|
|00000f90| 73 69 64 65 73 20 63 6c | 6f 73 69 6e 67 20 74 68 |sides cl|osing th|
|00000fa0| 65 20 77 69 6e 64 6f 77 | 20 61 6e 64 20 64 69 73 |e window| and dis|
|00000fb0| 70 6f 73 69 6e 67 20 6f | 66 20 74 68 65 20 61 6c |posing o|f the al|
|00000fc0| 6c 6f 63 61 74 65 64 20 | 6d 65 6d 6f 72 79 20 73 |located |memory s|
|00000fd0| 74 72 75 63 74 75 72 65 | 73 20 69 74 0d 72 65 73 |tructure|s it.res|
|00000fe0| 74 6f 72 65 73 20 74 68 | 65 20 64 65 76 69 63 65 |tores th|e device|
|00000ff0| 27 73 20 63 6c 75 74 20 | 74 6f 20 77 68 61 74 65 |'s clut |to whate|
|00001000| 76 65 72 20 69 73 20 69 | 6e 20 74 68 65 20 63 6f |ver is i|n the co|
|00001010| 6c 6f 72 20 74 61 62 6c | 65 20 61 73 73 6f 63 69 |lor tabl|e associ|
|00001020| 61 74 65 64 20 77 69 74 | 68 20 64 65 76 69 63 65 |ated wit|h device|
|00001030| 2e 0d 0d 48 49 53 54 4f | 52 59 3a 0d 0d 31 32 2f |...HISTO|RY:..12/|
|00001040| 38 38 09 09 64 67 70 09 | 77 72 6f 74 65 20 69 74 |88..dgp.|wrote it|
|00001050| 0d 38 2f 35 2f 38 39 09 | 09 09 61 64 64 65 64 20 |.8/5/89.|..added |
|00001060| 63 61 6c 6c 20 74 6f 20 | 47 44 55 6e 63 6f 72 72 |call to |GDUncorr|
|00001070| 65 63 74 65 64 47 61 6d | 6d 61 2c 20 73 6f 20 49 |ectedGam|ma, so I|
|00001080| 20 63 6f 75 6c 64 6e 27 | 74 20 66 6f 72 67 65 74 | couldn'|t forget|
|00001090| 2e 0d 38 2f 31 35 2f 38 | 39 20 09 64 67 70 20 74 |..8/15/8|9 .dgp t|
|000010a0| 72 69 76 69 61 0d 33 2f | 32 30 2f 39 30 09 09 64 |rivia.3/|20/90..d|
|000010b0| 67 70 09 6d 61 6b 65 20 | 63 6f 6d 70 61 74 69 62 |gp.make |compatib|
|000010c0| 6c 65 20 77 69 74 68 20 | 4d 50 57 20 43 2e 0d 33 |le with |MPW C..3|
|000010d0| 2f 32 39 2f 39 30 09 09 | 64 67 70 09 63 68 61 6e |/29/90..|dgp.chan|
|000010e0| 67 65 64 20 64 65 63 6c | 61 72 65 64 20 72 65 74 |ged decl|ared ret|
|000010f0| 75 72 6e 65 64 20 74 79 | 70 65 20 66 72 6f 6d 20 |urned ty|pe from |
|00001100| 57 69 6e 64 6f 77 50 74 | 72 20 74 6f 20 43 57 69 |WindowPt|r to CWi|
|00001110| 6e 64 6f 77 50 74 72 2c | 20 77 68 69 63 68 0d 09 |ndowPtr,| which..|
|00001120| 09 09 09 69 73 20 77 68 | 61 74 20 69 74 27 73 20 |...is wh|at it's |
|00001130| 72 65 61 6c 6c 79 20 62 | 65 65 6e 20 61 6c 6c 20 |really b|een all |
|00001140| 61 6c 6f 6e 67 2e 20 53 | 61 6d 65 20 63 68 61 6e |along. S|ame chan|
|00001150| 67 65 20 74 6f 20 61 72 | 67 75 6d 65 6e 74 20 6f |ge to ar|gument o|
|00001160| 66 0d 09 09 09 09 47 44 | 44 69 73 70 6f 73 65 57 |f.....GD|DisposeW|
|00001170| 69 6e 64 6f 77 28 29 2e | 20 54 68 65 20 6e 65 77 |indow().| The new|
|00001180| 20 6f 66 66 73 63 72 65 | 65 6e 20 47 57 6f 72 6c | offscre|en GWorl|
|00001190| 64 20 63 61 6c 6c 73 20 | 66 6f 72 20 74 68 65 20 |d calls |for the |
|000011a0| 66 69 72 73 74 20 74 69 | 6d 65 0d 09 09 09 09 6d |first ti|me.....m|
|000011b0| 61 6b 65 20 69 74 20 65 | 61 73 69 65 72 20 74 6f |ake it e|asier to|
|000011c0| 20 68 6f 6e 65 73 74 6c | 79 20 64 65 63 6c 61 72 | honestl|y declar|
|000011d0| 65 20 6f 6e 65 27 73 20 | 77 69 6e 64 6f 77 73 20 |e one's |windows |
|000011e0| 61 73 20 63 6f 6c 6f 72 | 20 72 61 74 68 65 72 0d |as color| rather.|
|000011f0| 09 09 09 09 74 68 61 6e | 20 70 72 65 74 65 6e 64 |....than| pretend|
|00001200| 69 6e 67 20 74 68 65 79 | 27 72 65 20 6e 6f 74 2e |ing they|'re not.|
|00001210| 0d 38 2f 32 34 2f 39 31 | 09 09 64 67 70 09 4d 61 |.8/24/91|..dgp.Ma|
|00001220| 64 65 20 63 6f 6d 70 61 | 74 69 62 6c 65 20 77 69 |de compa|tible wi|
|00001230| 74 68 20 54 48 49 4e 4b | 20 43 20 35 2e 30 2e 0d |th THINK| C 5.0..|
|00001240| 32 2f 31 2f 39 32 09 09 | 64 67 70 20 4d 61 64 65 |2/1/92..|dgp Made|
|00001250| 20 6f 70 74 69 6f 6e 61 | 6c 20 74 68 65 20 64 65 | optiona|l the de|
|00001260| 76 69 63 65 20 61 72 67 | 75 6d 65 6e 74 20 74 6f |vice arg|ument to|
|00001270| 20 47 44 44 69 73 70 6f | 73 65 57 69 6e 64 6f 77 | GDDispo|seWindow|
|00001280| 28 29 2e 20 49 66 20 69 | 74 27 73 0d 09 09 09 09 |(). If i|t's.....|
|00001290| 4e 55 4c 4c 2c 20 74 68 | 65 6e 20 69 74 20 77 69 |NULL, th|en it wi|
|000012a0| 6c 6c 20 62 65 20 64 65 | 74 65 72 6d 69 6e 65 64 |ll be de|termined|
|000012b0| 20 61 75 74 6f 6d 61 74 | 69 63 61 6c 6c 79 20 66 | automat|ically f|
|000012c0| 72 6f 6d 20 77 69 6e 64 | 6f 77 2e 0d 32 2f 33 2f |rom wind|ow..2/3/|
|000012d0| 39 33 09 09 64 68 62 09 | 45 78 74 72 61 63 74 65 |93..dhb.|Extracte|
|000012e0| 64 20 41 64 64 45 78 70 | 6c 69 63 69 74 50 61 6c |d AddExp|licitPal|
|000012f0| 65 74 74 65 20 66 72 6f | 6d 20 47 44 4f 70 65 6e |ette fro|m GDOpen|
|00001300| 57 69 6e 64 6f 77 2e 0d | 32 2f 32 31 2f 39 33 09 |Window..|2/21/93.|
|00001310| 09 64 67 70 09 48 69 64 | 65 4d 65 6e 75 42 61 72 |.dgp.Hid|eMenuBar|
|00001320| 20 69 66 20 77 69 6e 64 | 6f 77 20 69 73 20 6f 6e | if wind|ow is on|
|00001330| 20 6d 61 69 6e 20 73 63 | 72 65 65 6e 2e 0d 32 2f | main sc|reen..2/|
|00001340| 32 33 2f 39 33 09 09 64 | 67 70 20 41 64 64 45 78 |23/93..d|gp AddEx|
|00001350| 70 6c 69 63 69 74 50 61 | 6c 65 74 74 65 28 29 20 |plicitPa|lette() |
|00001360| 72 65 74 75 72 6e 73 20 | 69 6d 6d 65 64 69 61 74 |returns |immediat|
|00001370| 65 6c 79 20 75 6e 6c 65 | 73 73 20 69 74 20 72 65 |ely unle|ss it re|
|00001380| 63 65 69 76 65 73 20 61 | 20 63 6f 6c 6f 72 20 0d |ceives a| color .|
|00001390| 09 09 09 09 77 69 6e 64 | 6f 77 2e 0d 09 09 09 09 |....wind|ow......|
|000013a0| 41 64 64 65 64 20 47 44 | 4f 70 65 6e 57 69 6e 64 |Added GD|OpenWind|
|000013b0| 6f 77 31 28 29 20 61 6e | 64 20 47 44 44 69 73 70 |ow1() an|d GDDisp|
|000013c0| 6f 73 65 57 69 6e 64 6f | 77 31 28 29 2c 20 77 68 |oseWindo|w1(), wh|
|000013d0| 69 63 68 20 62 6f 74 68 | 20 75 73 65 0d 09 09 09 |ich both| use....|
|000013e0| 09 61 20 57 69 6e 64 6f | 77 50 74 72 2c 20 69 6e |.a Windo|wPtr, in|
|000013f0| 73 74 65 61 64 20 6f 66 | 20 61 20 6c 65 73 73 20 |stead of| a less |
|00001400| 63 6f 6e 76 65 6e 69 65 | 6e 74 20 43 57 69 6e 64 |convenie|nt CWind|
|00001410| 6f 77 50 74 72 2e 0d 33 | 2f 35 2f 39 33 09 09 64 |owPtr..3|/5/93..d|
|00001420| 67 70 09 41 64 64 65 64 | 20 63 61 6c 6c 73 20 74 |gp.Added| calls t|
|00001430| 6f 20 55 6e 63 6c 69 70 | 53 63 72 65 65 6e 28 29 |o Unclip|Screen()|
|00001440| 20 61 6e 64 20 52 65 73 | 74 6f 72 65 53 63 72 65 | and Res|toreScre|
|00001450| 65 6e 43 6c 69 70 70 69 | 6e 67 28 29 2c 20 73 6f |enClippi|ng(), so|
|00001460| 20 74 68 65 20 77 69 6e | 64 6f 77 0d 09 09 09 09 | the win|dow.....|
|00001470| 6e 6f 77 20 74 72 75 6c | 79 20 66 69 6c 6c 73 20 |now trul|y fills |
|00001480| 74 68 65 20 77 68 6f 6c | 65 20 73 63 72 65 65 6e |the whol|e screen|
|00001490| 2e 20 45 64 69 74 65 64 | 20 47 44 4f 70 65 6e 57 |. Edited| GDOpenW|
|000014a0| 69 6e 64 6f 77 28 29 20 | 66 6f 72 20 63 6c 61 72 |indow() |for clar|
|000014b0| 69 74 79 2e 0d 33 2f 37 | 2f 38 33 09 09 64 67 70 |ity..3/7|/83..dgp|
|000014c0| 09 41 64 64 65 64 20 63 | 61 6c 6c 73 20 74 6f 20 |.Added c|alls to |
|000014d0| 47 44 53 61 76 65 47 61 | 6d 6d 61 28 64 65 76 69 |GDSaveGa|mma(devi|
|000014e0| 63 65 29 20 61 6e 64 20 | 47 44 52 65 73 74 6f 72 |ce) and |GDRestor|
|000014f0| 65 47 61 6d 6d 61 28 64 | 65 76 69 63 65 29 2e 0d |eGamma(d|evice)..|
|00001500| 2a 2f 0d 23 69 6e 63 6c | 75 64 65 20 22 56 69 64 |*/.#incl|ude "Vid|
|00001510| 65 6f 54 6f 6f 6c 62 6f | 78 2e 68 22 0d 0d 23 64 |eoToolbo|x.h"..#d|
|00001520| 65 66 69 6e 65 20 4d 41 | 4b 45 5f 43 4f 4c 4f 52 |efine MA|KE_COLOR|
|00001530| 5f 54 41 42 4c 45 20 30 | 0d 0d 57 69 6e 64 6f 77 |_TABLE 0|..Window|
|00001540| 50 74 72 20 47 44 4f 70 | 65 6e 57 69 6e 64 6f 77 |Ptr GDOp|enWindow|
|00001550| 31 28 47 44 48 61 6e 64 | 6c 65 20 64 65 76 69 63 |1(GDHand|le devic|
|00001560| 65 29 0d 7b 0d 09 72 65 | 74 75 72 6e 20 28 57 69 |e).{..re|turn (Wi|
|00001570| 6e 64 6f 77 50 74 72 29 | 47 44 4f 70 65 6e 57 69 |ndowPtr)|GDOpenWi|
|00001580| 6e 64 6f 77 28 64 65 76 | 69 63 65 29 3b 0d 7d 0d |ndow(dev|ice);.}.|
|00001590| 0d 76 6f 69 64 20 47 44 | 44 69 73 70 6f 73 65 57 |.void GD|DisposeW|
|000015a0| 69 6e 64 6f 77 31 28 57 | 69 6e 64 6f 77 50 74 72 |indow1(W|indowPtr|
|000015b0| 20 77 69 6e 64 6f 77 29 | 0d 7b 0d 09 47 44 44 69 | window)|.{..GDDi|
|000015c0| 73 70 6f 73 65 57 69 6e | 64 6f 77 28 4e 55 4c 4c |sposeWin|dow(NULL|
|000015d0| 2c 28 43 57 69 6e 64 6f | 77 50 74 72 29 20 77 69 |,(CWindo|wPtr) wi|
|000015e0| 6e 64 6f 77 29 3b 0d 7d | 0d 0d 0d 43 57 69 6e 64 |ndow);.}|...CWind|
|000015f0| 6f 77 50 74 72 20 47 44 | 4f 70 65 6e 57 69 6e 64 |owPtr GD|OpenWind|
|00001600| 6f 77 28 47 44 48 61 6e | 64 6c 65 20 64 65 76 69 |ow(GDHan|dle devi|
|00001610| 63 65 29 0d 7b 0d 09 57 | 69 6e 64 6f 77 50 74 72 |ce).{..W|indowPtr|
|00001620| 20 77 69 6e 64 6f 77 3b | 0d 09 52 65 63 74 20 72 | window;|..Rect r|
|00001630| 3b 0d 09 47 44 48 61 6e | 64 6c 65 20 6f 6c 64 44 |;..GDHan|dle oldD|
|00001640| 65 76 69 63 65 3b 0d 0d | 09 69 66 28 64 65 76 69 |evice;..|.if(devi|
|00001650| 63 65 3d 3d 4e 55 4c 4c | 29 72 65 74 75 72 6e 20 |ce==NULL|)return |
|00001660| 4e 55 4c 4c 3b 0d 09 72 | 3d 28 2a 64 65 76 69 63 |NULL;..r|=(*devic|
|00001670| 65 29 2d 3e 67 64 52 65 | 63 74 3b 09 09 2f 2f 20 |e)->gdRe|ct;..// |
|00001680| 72 65 63 74 20 6f 66 20 | 64 65 73 69 72 65 64 20 |rect of |desired |
|00001690| 73 63 72 65 65 6e 20 69 | 6e 20 67 6c 6f 62 61 6c |screen i|n global|
|000016a0| 20 63 6f 6f 72 64 69 6e | 61 74 65 73 0d 09 47 44 | coordin|ates..GD|
|000016b0| 53 61 76 65 47 61 6d 6d | 61 28 64 65 76 69 63 65 |SaveGamm|a(device|
|000016c0| 29 3b 0d 09 47 44 55 6e | 63 6f 72 72 65 63 74 65 |);..GDUn|correcte|
|000016d0| 64 47 61 6d 6d 61 28 64 | 65 76 69 63 65 29 3b 0d |dGamma(d|evice);.|
|000016e0| 09 55 6e 63 6c 69 70 53 | 63 72 65 65 6e 28 64 65 |.UnclipS|creen(de|
|000016f0| 76 69 63 65 29 3b 0d 09 | 6f 6c 64 44 65 76 69 63 |vice);..|oldDevic|
|00001700| 65 3d 47 65 74 47 44 65 | 76 69 63 65 28 29 3b 0d |e=GetGDe|vice();.|
|00001710| 09 53 65 74 47 44 65 76 | 69 63 65 28 47 65 74 4d |.SetGDev|ice(GetM|
|00001720| 61 69 6e 44 65 76 69 63 | 65 28 29 29 3b 0d 09 77 |ainDevic|e());..w|
|00001730| 69 6e 64 6f 77 3d 4e 65 | 77 43 57 69 6e 64 6f 77 |indow=Ne|wCWindow|
|00001740| 28 4e 55 4c 4c 2c 26 72 | 2c 22 5c 70 48 69 22 2c |(NULL,&r|,"\pHi",|
|00001750| 54 52 55 45 2c 70 6c 61 | 69 6e 44 42 6f 78 2c 28 |TRUE,pla|inDBox,(|
|00001760| 57 69 6e 64 6f 77 50 74 | 72 29 20 2d 31 4c 2c 30 |WindowPt|r) -1L,0|
|00001770| 2c 31 32 33 4c 29 3b 0d | 09 53 65 74 47 44 65 76 |,123L);.|.SetGDev|
|00001780| 69 63 65 28 6f 6c 64 44 | 65 76 69 63 65 29 3b 0d |ice(oldD|evice);.|
|00001790| 09 41 64 64 45 78 70 6c | 69 63 69 74 50 61 6c 65 |.AddExpl|icitPale|
|000017a0| 74 74 65 28 77 69 6e 64 | 6f 77 29 3b 0d 09 72 65 |tte(wind|ow);..re|
|000017b0| 74 75 72 6e 20 28 43 57 | 69 6e 64 6f 77 50 74 72 |turn (CW|indowPtr|
|000017c0| 29 77 69 6e 64 6f 77 3b | 0d 7d 0d 0d 76 6f 69 64 |)window;|.}..void|
|000017d0| 20 47 44 44 69 73 70 6f | 73 65 57 69 6e 64 6f 77 | GDDispo|seWindow|
|000017e0| 28 47 44 48 61 6e 64 6c | 65 20 64 65 76 69 63 65 |(GDHandl|e device|
|000017f0| 2c 43 57 69 6e 64 6f 77 | 50 74 72 20 77 69 6e 64 |,CWindow|Ptr wind|
|00001800| 6f 77 29 0d 2f 2f 20 44 | 69 73 70 6f 73 65 20 6f |ow).// D|ispose o|
|00001810| 66 20 77 69 6e 64 6f 77 | 20 61 6e 64 20 70 61 6c |f window| and pal|
|00001820| 65 74 74 65 20 61 6e 64 | 20 72 65 73 74 6f 72 65 |ette and| restore|
|00001830| 20 74 68 65 20 63 6c 75 | 74 2e 0d 7b 0d 09 69 66 | the clu|t..{..if|
|00001840| 28 77 69 6e 64 6f 77 3d | 3d 4e 55 4c 4c 29 72 65 |(window=|=NULL)re|
|00001850| 74 75 72 6e 3b 0d 09 69 | 66 28 64 65 76 69 63 65 |turn;..i|f(device|
|00001860| 3d 3d 4e 55 4c 4c 29 64 | 65 76 69 63 65 3d 47 65 |==NULL)d|evice=Ge|
|00001870| 74 57 69 6e 64 6f 77 44 | 65 76 69 63 65 28 28 57 |tWindowD|evice((W|
|00001880| 69 6e 64 6f 77 50 74 72 | 29 77 69 6e 64 6f 77 29 |indowPtr|)window)|
|00001890| 3b 0d 09 44 69 73 70 6f | 73 65 50 61 6c 65 74 74 |;..Dispo|sePalett|
|000018a0| 65 28 47 65 74 50 61 6c | 65 74 74 65 28 28 57 69 |e(GetPal|ette((Wi|
|000018b0| 6e 64 6f 77 50 74 72 29 | 77 69 6e 64 6f 77 29 29 |ndowPtr)|window))|
|000018c0| 3b 0d 09 23 69 66 20 4d | 41 4b 45 5f 43 4f 4c 4f |;..#if M|AKE_COLO|
|000018d0| 52 5f 54 41 42 4c 45 0d | 09 09 44 69 73 70 6f 73 |R_TABLE.|..Dispos|
|000018e0| 48 61 6e 64 6c 65 28 28 | 48 61 6e 64 6c 65 29 28 |Handle((|Handle)(|
|000018f0| 2a 28 28 43 47 72 61 66 | 50 74 72 29 77 69 6e 64 |*((CGraf|Ptr)wind|
|00001900| 6f 77 29 2d 3e 70 6f 72 | 74 50 69 78 4d 61 70 29 |ow)->por|tPixMap)|
|00001910| 2d 3e 70 6d 54 61 62 6c | 65 29 3b 0d 09 23 65 6e |->pmTabl|e);..#en|
|00001920| 64 69 66 0d 09 44 69 73 | 70 6f 73 65 57 69 6e 64 |dif..Dis|poseWind|
|00001930| 6f 77 28 28 57 69 6e 64 | 6f 77 50 74 72 29 77 69 |ow((Wind|owPtr)wi|
|00001940| 6e 64 6f 77 29 3b 0d 09 | 69 66 28 64 65 76 69 63 |ndow);..|if(devic|
|00001950| 65 3d 3d 4e 55 4c 4c 29 | 72 65 74 75 72 6e 3b 0d |e==NULL)|return;.|
|00001960| 09 47 44 52 65 73 74 6f | 72 65 47 61 6d 6d 61 28 |.GDResto|reGamma(|
|00001970| 64 65 76 69 63 65 29 3b | 0d 09 47 44 52 65 73 74 |device);|..GDRest|
|00001980| 6f 72 65 44 65 76 69 63 | 65 43 6c 75 74 28 64 65 |oreDevic|eClut(de|
|00001990| 76 69 63 65 29 3b 0d 09 | 52 65 73 74 6f 72 65 53 |vice);..|RestoreS|
|000019a0| 63 72 65 65 6e 43 6c 69 | 70 70 69 6e 67 28 64 65 |creenCli|pping(de|
|000019b0| 76 69 63 65 29 3b 0d 7d | 0d 0d 76 6f 69 64 20 41 |vice);.}|..void A|
|000019c0| 64 64 45 78 70 6c 69 63 | 69 74 50 61 6c 65 74 74 |ddExplic|itPalett|
|000019d0| 65 28 57 69 6e 64 6f 77 | 50 74 72 20 77 69 6e 64 |e(Window|Ptr wind|
|000019e0| 6f 77 29 0d 2f 2f 20 43 | 72 65 61 74 65 20 61 20 |ow).// C|reate a |
|000019f0| 70 61 6c 65 74 74 65 20 | 66 6f 72 20 74 68 65 20 |palette |for the |
|00001a00| 63 6f 6c 6f 72 20 77 69 | 6e 64 6f 77 20 61 6e 64 |color wi|ndow and|
|00001a10| 20 6d 61 72 6b 20 61 6c | 6c 20 74 68 65 20 65 6e | mark al|l the en|
|00001a20| 74 72 69 65 73 20 61 73 | 20 65 78 70 6c 69 63 69 |tries as| explici|
|00001a30| 74 2e 0d 2f 2f 20 43 6f | 70 79 20 74 68 65 20 65 |t..// Co|py the e|
|00001a40| 6e 74 72 69 65 73 20 66 | 72 6f 6d 20 74 68 65 20 |ntries f|rom the |
|00001a50| 77 69 6e 64 6f 77 27 73 | 20 64 65 76 69 63 65 2e |window's| device.|
|00001a60| 0d 7b 0d 09 47 44 48 61 | 6e 64 6c 65 20 64 65 76 |.{..GDHa|ndle dev|
|00001a70| 69 63 65 3b 0d 09 43 54 | 61 62 48 61 6e 64 6c 65 |ice;..CT|abHandle|
|00001a80| 20 63 54 61 62 48 61 6e | 64 6c 65 3b 0d 09 50 61 | cTabHan|dle;..Pa|
|00001a90| 6c 65 74 74 65 48 61 6e | 64 6c 65 20 70 61 6c 65 |letteHan|dle pale|
|00001aa0| 74 74 65 3b 0d 09 69 6e | 74 20 63 6f 6c 6f 72 73 |tte;..in|t colors|
|00001ab0| 2c 69 3b 0d 09 4f 53 45 | 72 72 20 65 72 72 6f 72 |,i;..OSE|rr error|
|00001ac0| 3b 0d 0d 09 69 66 28 77 | 69 6e 64 6f 77 3d 3d 4e |;...if(w|indow==N|
|00001ad0| 55 4c 4c 29 72 65 74 75 | 72 6e 3b 0d 09 69 66 28 |ULL)retu|rn;..if(|
|00001ae0| 28 28 43 47 72 61 66 50 | 74 72 29 77 69 6e 64 6f |((CGrafP|tr)windo|
|00001af0| 77 29 2d 3e 70 6f 72 74 | 56 65 72 73 69 6f 6e 3e |w)->port|Version>|
|00001b00| 3d 30 29 20 72 65 74 75 | 72 6e 3b 09 2f 2f 20 4e |=0) retu|rn;.// N|
|00001b10| 6f 74 20 61 20 63 6f 6c | 6f 72 20 77 69 6e 64 6f |ot a col|or windo|
|00001b20| 77 2c 20 72 65 74 75 72 | 6e 2e 0d 09 64 65 76 69 |w, retur|n...devi|
|00001b30| 63 65 3d 47 65 74 57 69 | 6e 64 6f 77 44 65 76 69 |ce=GetWi|ndowDevi|
|00001b40| 63 65 28 77 69 6e 64 6f | 77 29 3b 0d 09 69 66 28 |ce(windo|w);..if(|
|00001b50| 64 65 76 69 63 65 3d 3d | 4e 55 4c 4c 29 50 72 69 |device==|NULL)Pri|
|00001b60| 6e 74 66 45 78 69 74 28 | 22 41 64 64 45 78 70 6c |ntfExit(|"AddExpl|
|00001b70| 69 63 69 74 50 61 6c 65 | 74 74 65 3a 20 77 69 6e |icitPale|tte: win|
|00001b80| 64 6f 77 20 68 61 73 20 | 6e 6f 20 64 65 76 69 63 |dow has |no devic|
|00001b90| 65 21 5c 6e 22 29 3b 0d | 09 63 54 61 62 48 61 6e |e!\n");.|.cTabHan|
|00001ba0| 64 6c 65 3d 28 2a 2a 28 | 2a 2a 64 65 76 69 63 65 |dle=(**(|**device|
|00001bb0| 29 2e 67 64 50 4d 61 70 | 29 2e 70 6d 54 61 62 6c |).gdPMap|).pmTabl|
|00001bc0| 65 3b 0d 09 63 6f 6c 6f | 72 73 3d 28 2a 63 54 61 |e;..colo|rs=(*cTa|
|00001bd0| 62 48 61 6e 64 6c 65 29 | 2d 3e 63 74 53 69 7a 65 |bHandle)|->ctSize|
|00001be0| 2b 31 3b 0d 09 23 69 66 | 20 4d 41 4b 45 5f 43 4f |+1;..#if| MAKE_CO|
|00001bf0| 4c 4f 52 5f 54 41 42 4c | 45 0d 09 09 65 72 72 6f |LOR_TABL|E...erro|
|00001c00| 72 3d 48 61 6e 64 54 6f | 48 61 6e 64 28 28 48 61 |r=HandTo|Hand((Ha|
|00001c10| 6e 64 6c 65 2a 29 26 63 | 54 61 62 48 61 6e 64 6c |ndle*)&c|TabHandl|
|00001c20| 65 29 3b 0d 09 09 69 66 | 28 65 72 72 6f 72 29 50 |e);...if|(error)P|
|00001c30| 72 69 6e 74 66 45 78 69 | 74 28 22 41 64 64 45 78 |rintfExi|t("AddEx|
|00001c40| 70 6c 69 63 69 74 50 61 | 6c 65 74 74 65 3a 20 65 |plicitPa|lette: e|
|00001c50| 72 72 6f 72 20 25 64 20 | 69 6e 20 63 6f 70 79 69 |rror %d |in copyi|
|00001c60| 6e 67 20 63 6f 6c 6f 72 | 20 74 61 62 6c 65 5c 6e |ng color| table\n|
|00001c70| 22 2c 65 72 72 6f 72 29 | 3b 0d 09 09 66 6f 72 28 |",error)|;...for(|
|00001c80| 69 3d 30 3b 69 3c 63 6f | 6c 6f 72 73 3b 69 2b 2b |i=0;i<co|lors;i++|
|00001c90| 29 20 28 2a 63 54 61 62 | 48 61 6e 64 6c 65 29 2d |) (*cTab|Handle)-|
|00001ca0| 3e 63 74 54 61 62 6c 65 | 5b 69 5d 2e 76 61 6c 75 |>ctTable|[i].valu|
|00001cb0| 65 3d 69 3b 0d 09 09 28 | 2a 63 54 61 62 48 61 6e |e=i;...(|*cTabHan|
|00001cc0| 64 6c 65 29 2d 3e 63 74 | 46 6c 61 67 73 20 26 3d |dle)->ct|Flags &=|
|00001cd0| 20 30 78 37 66 66 66 3b | 0d 09 09 28 2a 63 54 61 | 0x7fff;|...(*cTa|
|00001ce0| 62 48 61 6e 64 6c 65 29 | 2d 3e 63 74 53 65 65 64 |bHandle)|->ctSeed|
|00001cf0| 3d 47 65 74 43 54 53 65 | 65 64 28 29 3b 0d 09 09 |=GetCTSe|ed();...|
|00001d00| 28 2a 28 28 43 47 72 61 | 66 50 74 72 29 77 69 6e |(*((CGra|fPtr)win|
|00001d10| 64 6f 77 29 2d 3e 70 6f | 72 74 50 69 78 4d 61 70 |dow)->po|rtPixMap|
|00001d20| 29 2d 3e 70 6d 54 61 62 | 6c 65 3d 63 54 61 62 48 |)->pmTab|le=cTabH|
|00001d30| 61 6e 64 6c 65 3b 0d 09 | 23 65 6e 64 69 66 0d 09 |andle;..|#endif..|
|00001d40| 70 61 6c 65 74 74 65 3d | 4e 65 77 50 61 6c 65 74 |palette=|NewPalet|
|00001d50| 74 65 28 63 6f 6c 6f 72 | 73 2c 63 54 61 62 48 61 |te(color|s,cTabHa|
|00001d60| 6e 64 6c 65 2c 70 6d 45 | 78 70 6c 69 63 69 74 2c |ndle,pmE|xplicit,|
|00001d70| 30 29 3b 0d 09 53 65 74 | 50 61 6c 65 74 74 65 28 |0);..Set|Palette(|
|00001d80| 77 69 6e 64 6f 77 2c 70 | 61 6c 65 74 74 65 2c 30 |window,p|alette,0|
|00001d90| 29 3b 0d 7d 00 00 00 00 | 00 00 00 00 00 00 00 00 |);.}....|........|
|00001da0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001db0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001dc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001dd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001de0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001df0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001e00| 00 00 01 00 00 00 01 a2 | 00 00 00 a2 00 00 00 4a |........|.......J|
|00001e10| 44 4c 69 6e 65 61 72 47 | 61 6d 6d 61 28 29 20 61 |DLinearG|amma() a|
|00001e20| 6e 64 20 47 44 53 65 74 | 45 6e 74 72 69 65 73 28 |nd GDSet|Entries(|
|00001e30| 0e 47 44 4f 70 65 6e 57 | 69 6e 64 6f 77 2e 63 6e |.GDOpenW|indow.cn|
|00001e40| 02 00 00 00 54 45 58 54 | 4b 41 48 4c 00 00 00 00 |....TEXT|KAHL....|
|00001e50| 00 00 54 45 58 54 4b 41 | 48 4c 00 00 00 00 00 00 |..TEXTKA|HL......|
|00001e60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001e70| 00 00 a7 e5 d5 b5 00 00 | 00 00 00 00 01 ec 6f 6c |........|......ol|
|00001e80| 6f 72 20 4d 61 6e 61 67 | 65 72 2e 20 53 69 6e 63 |or Manag|er. Sinc|
|00001e90| 65 0d 74 68 65 20 43 6f | 6c 6f 72 20 61 6e 64 20 |e.the Co|lor and |
|00001ea0| 50 61 6c 65 74 74 65 20 | 4d 61 6e 61 67 65 72 73 |Palette |Managers|
|00001eb0| 20 64 6f 6e 27 74 20 6b | 6e 6f 77 20 74 68 61 74 | don't k|now that|
|00001ec0| 20 79 6f 75 27 76 65 20 | 63 68 61 6e 67 65 64 20 | you've |changed |
|00001ed0| 74 68 65 20 63 6f 6c 6f | 72 20 65 6e 76 69 72 6f |the colo|r enviro|
|00001ee0| 6e 6d 65 6e 74 0d 74 68 | 65 79 20 63 61 6e 27 74 |nment.th|ey can't|
|00001ef0| 20 72 65 61 63 74 20 74 | 6f 20 69 74 2c 20 61 6e | react t|o it, an|
|00001f00| 00 00 00 48 00 09 4d 6f | 6e 61 63 6f 00 44 00 00 |...H..Mo|naco.D..|
|00001f10| 00 2a 01 44 7f ff 00 08 | 00 2a 01 28 7f ff 01 37 |.*.D....|.*.(...7|
|00001f20| 01 28 01 44 7f ff 00 06 | 00 04 00 50 00 20 01 8d |.(.D....|...P. ..|
|00001f30| 02 3d 00 50 00 20 01 8d | 02 3d a7 ab 5a 26 00 00 |.=.P. ..|.=..Z&..|
|00001f40| 11 ab 00 00 11 b1 00 00 | 11 65 01 00 00 00 00 1e |........|.e......|
|00001f50| 00 50 00 20 01 8d 02 3d | 00 50 00 20 01 8d 02 3d |.P. ...=|.P. ...=|
|00001f60| 00 00 11 65 00 00 00 00 | 00 00 00 00 00 00 00 00 |...e....|........|
|00001f70| 00 30 00 02 00 00 17 51 | 00 00 17 60 0f 47 44 44 |.0.....Q|...`.GDD|
|00001f80| 69 73 70 6f 73 65 57 69 | 6e 64 6f 77 00 00 15 76 |isposeWi|ndow...v|
|00001f90| 00 00 15 82 0d 47 44 4f | 70 65 6e 57 69 6e 64 6f |.....GDO|penWindo|
|00001fa0| 77 00 00 00 01 00 00 00 | 01 a2 00 00 00 a2 00 00 |w.......|........|
|00001fb0| 00 4a 00 5a c9 7c 06 fc | 00 00 00 1c 00 4a 00 00 |.J.Z.|..|.....J..|
|00001fc0| 4d 50 53 52 00 02 00 0a | 03 ed ff ff 00 00 00 00 |MPSR....|........|
|00001fd0| 00 00 00 00 03 f0 ff ff | 00 00 00 4c 00 00 00 00 |........|...L....|
|00001fe0| 03 ef ff ff 00 00 00 6e | 00 00 00 00 00 00 00 00 |.......n|........|
|00001ff0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+